<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    		<form class="form-horizontal" action="/content/save" method="post" id="contentForm">
		    <fieldset>
		    <div id="legend" class="">
        		<legend class="">提交内容</legend>
      		</div>
		    <div class="control-group">
				<input type="hidden" value="${content.id }" name="id">
		          <!-- Text input-->
		          <label class="control-label" for="input01">标题：</label>
		          <div class="controls">
		            <input type="text" placeholder="" class="input-xlarge" name="title" value="${content.title }">
		            <p class="help-block"></p>
		          </div>
		        </div>
		
		    <div class="control-group">
		          <label class="control-label" for="input01">开放时间：</label>
		          <div class="controls">
		            <input type="text" placeholder="" class="input-xlarge Wdate" name="openTime" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',readOnly:true})" value="${content.openTime }">
		          </div>
		     </div>
		
		    <div class="control-group">
		          <label class="control-label">线路：</label>
		          <div class="controls">
				      <select id="line" name="line">
	            		<option value="01">双线</option>
	            		<option value="02">电信</option>
	            		<option value="02">网通</option>
            		   </select>
		  		   </div>
		     </div>
		
		    <div class="control-group">
		
		          <!-- Text input-->
		          <label class="control-label" for="input01">主页地址：</label>
		          <div class="controls">
		            <input type="text" placeholder="" class="input-xlarge" name="site" value="${content.site }">
		            <p class="help-block"></p>
		          </div>
		        </div>
		        
				<div class="control-group">
		
		          <label class="control-label" for="input01">客服qq：</label>
		          <div class="controls">
		            <input type="text" placeholder="" class="input-xlarge" name="qq" value="${content.qq }">
		            <p class="help-block"></p>
		          </div>
		        </div>
		        
		    	<div class="control-group">
		          <label class="control-label">游戏简介：</label>
		          <div class="controls">
		            <div class="textarea">
		                  <textarea type="" class="" style="margin: 0px; width: 272px; height: 106px;" name="desc">${content.desc }</textarea>
		            </div>
		          </div>
		        </div>
		        
		        <div class="control-group">
		          <label class="control-label">审核：</label>
		          <div class="controls">
				      <select id="status" name="status">
						 <option value="01">未审核</option>
						 <option value="02">已审核</option>
            		   </select>
		  		   </div>
		     </div>
		 	<div class="control-group">
		
		          <div class="controls">
		           
		            <button type="submit" class="btn">提交</button>
		          </div>
		        </div>
		    </fieldset>
  			</form>
<script type="text/javascript">
   $(document).ready(function() {
	   $('#status').val('${content.status}');
	   $('#line').val('${content.line}');
	   $('#contentForm').ajaxForm({
			beforeSubmit:function(){
				return $('#contentForm').validate().form();
			},
			success:function(){
				$('#div_right').load("/content/manage");
			}
		});
	   
	   $("#contentForm").validate({
			rules: {
				title: {required:true,maxlength:30},
				openTime: "required",
				site: {required:true,url:true}
			},
			messages: {
				title: {required:"请填写标题",maxlength:"标题不能长于30个字"},
				openTime: "请选择时间",
				site: {required:"请填写主页",url:"请填写规范的主页"}
			}
		});
   });
</script>
